import Vue from 'vue';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App.vue';
import router from '@/router/index.js'
import common from './common/js/common/common'
import { req, downloadFile } from '@/api/index.js'

Vue.prototype.$common = common
Vue.prototype.$http = req
Vue.prototype.$downloadFile = downloadFile

if(process.env.NODE_ENV === 'development'){
  Vue.prototype.$devUrl = "http://127.0.0.1:5000"
}
else {
  Vue.prototype.$devUrl = "http://62.234.80.79:5000"

  // 屏蔽所有 console 方法
  const consoleMethods = ['log', 'warn', 'error', 'info', 'debug'];

  Vue.config.productionTip = false
  Vue.config.devtools = false
  

  if (Array.isArray(consoleMethods)) {
    consoleMethods.forEach(method => {
      console[method] = () => {};
    });
  }

}





import VueLazyload from "vue-lazyload";

// 过滤器
import * as custom from '@/assets/js/util'

Object.keys(custom).forEach(key => {
  Vue.filter(key, custom[key])
})

//或者自定义配置插件
Vue.use(VueLazyload, {
  attempt: 1,
  preLoad: 1.3,
  listenEvents: ['scroll']
})

Vue.use(ElementUI);

Vue.config.productionTip = false
// 创建事件总线
Vue.prototype.$bus = new Vue()
new Vue({
  render: h => h(App),
  router,
}).$mount('#app')
